import { mapGetters } from 'vuex'
import { setTheme } from '@/util/util'

export default function () {
    return {
        data() {
            return {
                text: 'default',
                list: [
                    {
                        name: "默认",
                        value: "default"
                    },
                    {
                        name: "炫彩",
                        value: "theme-star"
                    }
                ],
            }
        },
        created() {
            this.text = this.themeName
        },
        watch: {
            text: function (val) {
                this.$store.commit('SET_THEME_NAME', val)
                setTheme(val)
            }
        },
        computed: {
            ...mapGetters(['themeName'])
        },
        methods: {

        }
    }
}
